var mongoose = require("mongoose");
var db = require('./db');
var planeModel = db.model("plane",new mongoose.Schema({
    "company": {
        type:String,
        required:true
    },
    "plane": {
        type:String,
        required:true
    },
    "type": {
        type:Number,
        required:true
    },
    "airplaneNumber": {
        type:String,
        required:true
    },
    "number": {
        type:Number,
        required:true
    },
    "child":{
        type:Boolean,
        default:true
    },
    "baby": {
        type:Boolean,
        default:true
    },
    "economyClass": {
        "number": {
            type:Number,
            required:true
        },
        "space": {
            type:Number,
            required:true
        },
        "width": {
            type:Number,
            required:true
        },
        "angle": {
            type:Number,
            required:true
        },
    },
    "businessClass": {
        "number": {
            type:Number,
            required:true
        },
        "space": {
            type:Number,
            required:true
        },
        "width": {
            type:Number,
            required:true
        },
        "angle": {
            type:Number,
            required:true
        },
    },
    "firstClass": {
        "number": {
            type:Number,
            required:true
        },
        "space": {
            type:Number,
            required:true
        },
        "width": {
            type:Number,
            required:true
        },
        "angle": {
            type:Number,
            required:true
        },
    }
}),"plane");

module.exports = planeModel;